namespace cplusplus_ArrayDelete {
class Base {
public:
	virtual ~Base() {}
};
class Derived : public Base {};

Base* create() {
	Base* x = new Derived[10]; // note: Casting from 'Derived' to 'Base' here
	return x;
}

void foo() {
	Base* x = create();
	delete[] x; // warn: Deleting an array of 'Derived' objects as their base class 'Base' is undefined
}

void foo1() {
	Derived* d = new Derived[10];
	Derived& dref = *d;

	Base& bref = static_cast<Base&>(dref); // no note
	Base* b = &bref;
	delete[] b; // warn: Deleting an array of 'Derived' objects as their base class 'Base' is undefined
}
}